<template>
  <a-badge :color="color" :text="label || value" class="status-tag" />
</template>

<script setup>
  import colorConfigs from './config.ts'
  import { computed } from 'vue'

  const props = defineProps({
    label: String,
    value: [Number, String],
    type: {
      type: String,
      default: 'defalut',
    },
  })

  const config = colorConfigs[props.type]
  const color = computed(() => {
    return config[props.value] || 'gray'
  })
</script>
